﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace FCP.Data.Migrations
{
    public partial class form_enum_value_change : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "value",
                table: "t_enum_detail",
                type: "character varying(600)",
                maxLength: 600,
                nullable: true,
                oldClrType: typeof(int),
                oldType: "integer");

            migrationBuilder.AddColumn<string>(
                name: "label_label_id",
                table: "t_enum_detail",
                type: "character varying(50)",
                maxLength: 50,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "type",
                table: "t_enum",
                type: "integer",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateIndex(
                name: "IX_t_tree_field_create_time",
                table: "t_tree_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_tree_btn_create_time",
                table: "t_tree_btn",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_tree_create_time",
                table: "t_tree",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_panel_create_time",
                table: "t_table_panel",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_filter_group_create_time",
                table: "t_table_filter_group",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_filter_field_create_time",
                table: "t_table_filter_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_field_filter_group_create_time",
                table: "t_table_field_filter_group",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_field_filter_field_create_time",
                table: "t_table_field_filter_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_field_create_time",
                table: "t_table_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_btn_create_time",
                table: "t_table_btn",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_table_create_time",
                table: "t_table",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_search_field_filter_group_create_time",
                table: "t_search_field_filter_group",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_search_field_filter_field_create_time",
                table: "t_search_field_filter_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_search_field_create_time",
                table: "t_search_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_search_create_time",
                table: "t_search",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_label_detail_create_time",
                table: "t_label_detail",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_label_create_time",
                table: "t_label",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_import_field_create_time",
                table: "t_import_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_import_detail_create_time",
                table: "t_import_detail",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_import_create_time",
                table: "t_import",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_form_version_create_time",
                table: "t_form_version",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_form_create_time",
                table: "t_form",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_enum_detail_create_time",
                table: "t_enum_detail",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_enum_create_time",
                table: "t_enum",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_panel_create_time",
                table: "t_edit_panel",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_field_map_detail_create_time",
                table: "t_edit_field_map_detail",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_field_map_create_time",
                table: "t_edit_field_map",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_field_filter_group_create_time",
                table: "t_edit_field_filter_group",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_field_filter_field_create_time",
                table: "t_edit_field_filter_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_field_create_time",
                table: "t_edit_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_btn_create_time",
                table: "t_edit_btn",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_edit_create_time",
                table: "t_edit",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_custom_btn_create_time",
                table: "t_custom_btn",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_custom_create_time",
                table: "t_custom",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_chart_create_time",
                table: "t_chart",
                column: "create_time");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_t_tree_field_create_time",
                table: "t_tree_field");

            migrationBuilder.DropIndex(
                name: "IX_t_tree_btn_create_time",
                table: "t_tree_btn");

            migrationBuilder.DropIndex(
                name: "IX_t_tree_create_time",
                table: "t_tree");

            migrationBuilder.DropIndex(
                name: "IX_t_table_panel_create_time",
                table: "t_table_panel");

            migrationBuilder.DropIndex(
                name: "IX_t_table_filter_group_create_time",
                table: "t_table_filter_group");

            migrationBuilder.DropIndex(
                name: "IX_t_table_filter_field_create_time",
                table: "t_table_filter_field");

            migrationBuilder.DropIndex(
                name: "IX_t_table_field_filter_group_create_time",
                table: "t_table_field_filter_group");

            migrationBuilder.DropIndex(
                name: "IX_t_table_field_filter_field_create_time",
                table: "t_table_field_filter_field");

            migrationBuilder.DropIndex(
                name: "IX_t_table_field_create_time",
                table: "t_table_field");

            migrationBuilder.DropIndex(
                name: "IX_t_table_btn_create_time",
                table: "t_table_btn");

            migrationBuilder.DropIndex(
                name: "IX_t_table_create_time",
                table: "t_table");

            migrationBuilder.DropIndex(
                name: "IX_t_search_field_filter_group_create_time",
                table: "t_search_field_filter_group");

            migrationBuilder.DropIndex(
                name: "IX_t_search_field_filter_field_create_time",
                table: "t_search_field_filter_field");

            migrationBuilder.DropIndex(
                name: "IX_t_search_field_create_time",
                table: "t_search_field");

            migrationBuilder.DropIndex(
                name: "IX_t_search_create_time",
                table: "t_search");

            migrationBuilder.DropIndex(
                name: "IX_t_label_detail_create_time",
                table: "t_label_detail");

            migrationBuilder.DropIndex(
                name: "IX_t_label_create_time",
                table: "t_label");

            migrationBuilder.DropIndex(
                name: "IX_t_import_field_create_time",
                table: "t_import_field");

            migrationBuilder.DropIndex(
                name: "IX_t_import_detail_create_time",
                table: "t_import_detail");

            migrationBuilder.DropIndex(
                name: "IX_t_import_create_time",
                table: "t_import");

            migrationBuilder.DropIndex(
                name: "IX_t_form_version_create_time",
                table: "t_form_version");

            migrationBuilder.DropIndex(
                name: "IX_t_form_create_time",
                table: "t_form");

            migrationBuilder.DropIndex(
                name: "IX_t_enum_detail_create_time",
                table: "t_enum_detail");

            migrationBuilder.DropIndex(
                name: "IX_t_enum_create_time",
                table: "t_enum");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_panel_create_time",
                table: "t_edit_panel");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_field_map_detail_create_time",
                table: "t_edit_field_map_detail");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_field_map_create_time",
                table: "t_edit_field_map");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_field_filter_group_create_time",
                table: "t_edit_field_filter_group");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_field_filter_field_create_time",
                table: "t_edit_field_filter_field");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_field_create_time",
                table: "t_edit_field");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_btn_create_time",
                table: "t_edit_btn");

            migrationBuilder.DropIndex(
                name: "IX_t_edit_create_time",
                table: "t_edit");

            migrationBuilder.DropIndex(
                name: "IX_t_custom_btn_create_time",
                table: "t_custom_btn");

            migrationBuilder.DropIndex(
                name: "IX_t_custom_create_time",
                table: "t_custom");

            migrationBuilder.DropIndex(
                name: "IX_t_chart_create_time",
                table: "t_chart");

            migrationBuilder.DropColumn(
                name: "label_label_id",
                table: "t_enum_detail");

            migrationBuilder.DropColumn(
                name: "type",
                table: "t_enum");

            migrationBuilder.AlterColumn<int>(
                name: "value",
                table: "t_enum_detail",
                type: "integer",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(string),
                oldType: "character varying(600)",
                oldMaxLength: 600,
                oldNullable: true);
        }
    }
}
